package com.rentplant.controller;

import com.alibaba.fastjson.JSONObject;
import com.rentplant.Pojo.rentaljudgeanduser;
import com.rentplant.service.impl.rentalJudgeServiceImp;
import org.junit.platform.commons.function.Try;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/rentalJudge")
public class rentalJudgeController {
    @Autowired
    private rentalJudgeServiceImp rentaljudgeserviceimp;


    @RequestMapping("/rentalJudge")
    //搜索该租用信息的评论
    public List<rentaljudgeanduser> rentalJudge(@RequestBody JSONObject req){
        try {
            return rentaljudgeserviceimp.rentalJudge(req);
        }catch (Exception e){
            throw new RuntimeException(e);
        }
    }

    @RequestMapping("/addRentalJudge")
    //发布求租信息评论
    public  boolean addRentalJudge(@RequestBody JSONObject req){
        try {
            return rentaljudgeserviceimp.addRentalJudge(req);
        }catch (Exception e){
            throw new RuntimeException(e);
        }
    }

}
